Make sure you have restrictions that only allow images to be uploaded. If you have an upload field that doesn't have "images only" checked it can be used to upload malicious files. Another way to prevent abuse is to have files uploaded to a folder outside of the web root. That way they can't access or run files that have been uploaded.
Were malicious files places in the upload folder where the member images are uploaded to? If so, that is the likely source of the vulnerability.
You have to figure out what happened to work backwards and figure out how it could have happened. If pages were added to your site then file uploads is a likely way they got in. Look a the folder where the files were added and that might be able to help you track it down. If they are in a new folder they were likely spawned from a file in another location, so you have to find that file. Hackers don't usually clean up after themselves, so there will probably be a trail to the original vulnerability you can track down and seal off.