Changed the 'invalid picture size' error handling