I don't believe this has much to do with your problem, but: If you plan on using this on a server, you cannot use File object. Instead, you have to use a URL to the image's location on the server.