bug fix (new Image() TypeError)