Changed fig2png to accept pixel dimensions