the code you added to increase the memory limit should fix the problem, if it is not fixing the problem, there are 2 possibilities:
1) The code is not being uploaded to the server properly.
2) The host does not allow you to increase the memory limit.
to check to see if the memory limit setting is being changed, you can add the following in the body of your page:
Memory Limit: <?php echo(ini_get('memory_limit')); ?>
This will write the memory limit setting to the screen.