Fixed missing condition in getImage