It is highly recommended to have at least 64M of memory for PHP processes. In the majority of cases, almost all hosting providers already provide such memory amount or more. According to the file size of your images it may be required more memory.
To check how much memory is granted for PHP on your server you may check it directly in Joomla backend clicking on Help -> System info, then "PHP info" and searching for the parameter memory_limit
Here are a couple of common ways to increase the memory_limit as these are the general way web hosting servers have been setup and configured:
1) Use of php.ini file to override the settings:
- create a file and name it php.ini
- in this file added this line: memory_limit = 64M
- upload this file to your webroot
2) using .htaccess file to override the settings:
- open up your Joomla! .htaccess file (you can find this in your Joomla installation)
- If you do not have this file, in your Joomla! installation there should be a file named htaccess.txt
- Rename this htaccess.txt to .htaccess
- open up .htaccess file and add this line to the top of your .htaccess file: php_value memory_limit 64M
If both of these methods failed then please contact your hosting provider to ask if overriding PHP settings config is allowed. If is it, they should be able to advise you on this depending on their own server setup and configurations.