Update image.php

Fixed where the wrong Exceptions were thrown. This mixup happened while replacing the error messages with language keys.