here is how you can do it and it works:
copy the code under these lines and name the file rename.sh, then all you need to do is make it so that you can run the script and then run it useig ./rename.sh
#!/bin/bash
#
# Author:
# rename script
# rename.sh
x=0;
for filename in *.png
do
echo $filename;
x=`expr $x + 1`;
echo $x.png;
mv $filename $x.png;
done