The simple, answer is that you are storing them in the wrong place.
When you publish an app, it gets installed in a folder below either "Program files" or "Program files (x86)" both of which are write protected by default to reduce virus activity.
It works in dev because your app folder hangs off your code folder, and that isn't write protected.
So when you save your profile pics, the system throws an exception - which you are ignoring - because the folder is write protected and you can't put the images there.
The solution? Change where you store your images. This should help:
Where should I store my data?[
^]