Maybe not a direct answer to this question, but since you mentioned that the purpose of this is to restrict a file upload, the HTML5 answer to this problem would be to use:
<input type="file" accept="image/*">
In addition to that you may also want a server-side check.
In terms of all possible valid image types, there isn't really a simple answer, but most of the information you would need to construct one would be to consult with this list on wikipedia. It of course depends a bit on what the image is going to be used for. The set of images that can be rendered by a browser is going to be different from the set that can be opened in photoshop.