added faster getImage function